package com.hama.iotrust.common.mybatis.criteria;

import java.util.HashMap;
import java.util.Map;

import com.hama.iotrust.common.mybatis.criteria.Criteria;
import com.hama.iotrust.common.mybatis.criteria.CriteriaException;
import com.hama.iotrust.common.mybatis.criteria.Expression;

/**
 * 纯 SQL 语句表达式
 * 
 * @author 金建强(ptma@163.com)
 * @version 1.0.0
 * @since 2012-3-15 下午05:52:09
 */
public class SqlExpression implements Expression {

    private String m_sql = "";

    SqlExpression(String sql){
        m_sql = sql;
    }

    public String getSql() {
        StringBuilder sb = new StringBuilder();
        sb.append("(").append(m_sql).append(")");
        return sb.toString();
    }

    public Map<String, Object> getParameter() {
        Map<String, Object> map = new HashMap<String, Object>();
        return map;
    }

    public boolean verify(Criteria<?> criteria) {
        return true;
    }

    public void bind(Criteria<?> crit) throws CriteriaException {

    }
}
